// 获取当前时间
function currentTime () {
  const now = new Date()

  const year = now.getFullYear()
  let month = now.getMonth() + 1
  month = month < 10 ? '0' + month : month
  let d = now.getDate()
  d = d < 10 ? '0' + d : d
  let h = now.getHours()
  h = h < 10 ? '0' + h : h
  let m = now.getMinutes()
  m = m < 10 ? '0' + m : m
  let s = now.getSeconds()
  s = s < 10 ? '0' + s : s

  return year + '-' + month + '-' + d + ' ' + h + ':' + m + ':' + s
}

module.exports = currentTime
